Remove the last character from a bash variable

The following method, removes the last character from a bash variable by using a regular expression that matches any character. VAR=${VAR%?} The … Continue reading Remove the last character from a bash variable